import sys
from fomsv4 import Ui_Form
from PyQt5.QtWidgets import QApplication, QMainWindow


class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        self.ui.radioButton_redis.clicked.connect(self.Choice)

    # 定义单选按钮被选中方法
    def Choice(self):
        print('进入函数')
        choose_redis = self.ui.radioButton_redis.isChecked()
        print('进入函数2')
        choose_kafka = self.ui.radioButton_kafka.isChecked()
        print('进入函数3')
        choose_mysql = self.ui.radioButton_mysql.isChecked()
        choose_flink = self.ui.radioButton_flink.isChecked()
        choose_nacos = self.ui.radioButton_nacos.isChecked()
        redis_username = '1351'
        redis_passwd = r'131231231324'
        print('退出函数1')
        if choose_redis:
            print('进入if')
            self.ui.lineEdit_user.setText(redis_username)
            print('进入if2')
            self.ui.lineEdit_passwd.setText(redis_passwd)
            print('进入if3')
            self.ui.lineEdit_user.text()
            self.ui.lineEdit_passwd.text()
            print('退出if')
        print('退出函数3')


if __name__ == '__main__':
    app = QApplication(sys.argv)
    win = MainWindow()
    # ui = Ui_Form()
    # ui.setupUi(win)
    win.show()
    sys.exit(app.exec_())
